package com.example.petshopping.model;

/**
 * 短信验证码发送场景枚举
 * 对应后端 SmsSceneEnum
 */
public enum SmsSceneEnum {
    
    MEMBER_LOGIN(1, "user-sms-login", "会员用户 - 手机号登陆"),
    MEMBER_UPDATE_MOBILE(2, "user-update-mobile", "会员用户 - 修改手机"),
    MEMBER_UPDATE_PASSWORD(3, "user-update-password", "会员用户 - 修改密码"),
    MEMBER_RESET_PASSWORD(4, "user-reset-password", "会员用户 - 忘记密码"),
    
    ADMIN_MEMBER_LOGIN(21, "admin-sms-login", "后台用户 - 手机号登录"),
    ADMIN_MEMBER_REGISTER(22, "admin-sms-register", "后台用户 - 手机号注册"),
    ADMIN_MEMBER_RESET_PASSWORD(23, "admin-reset-password", "后台用户 - 忘记密码");

    private final Integer scene;
    private final String templateCode;
    private final String description;

    SmsSceneEnum(Integer scene, String templateCode, String description) {
        this.scene = scene;
        this.templateCode = templateCode;
        this.description = description;
    }

    public Integer getScene() {
        return scene;
    }

    public String getTemplateCode() {
        return templateCode;
    }

    public String getDescription() {
        return description;
    }

    /**
     * 根据场景编号获取枚举
     */
    public static SmsSceneEnum getCodeByScene(Integer scene) {
        for (SmsSceneEnum sceneEnum : values()) {
            if (sceneEnum.getScene().equals(scene)) {
                return sceneEnum;
            }
        }
        return null;
    }
} 